# 写文件  mode="w" 时,会把原文件中的内容覆盖
# fp = open("33.txt",mode="w",encoding="utf-8")
# mode="a",向原文件中追加内容
'''
fp = open("33.txt",mode="a",encoding="utf-8")
fp.write("哈哈!")
fp.flush()
fp.close()
'''
# with-as  自动关闭文件
with open("765.txt", mode="w", encoding="utf-8") as fp1:
    fp1.write("lele")
    fp1.flush()